/*
 * Copyright (C) 1994-2021 Altair Engineering, Inc.
 * For more information, contact Altair at www.altair.com.
 *
 * This file is part of both the OpenPBS software ("OpenPBS")
 * and the PBS Professional ("PBS Pro") software.
 *
 * Open Source License Information:
 *
 * OpenPBS is free software. You can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * OpenPBS is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Commercial License Information:
 *
 * PBS Pro is commercially licensed software that shares a common core with
 * the OpenPBS software.  For a copy of the commercial license terms and
 * conditions, go to: (http://www.pbspro.com/agreement.html) or contact the
 * Altair Legal Department.
 *
 * Altair's dual-license business model allows companies, individuals, and
 * organizations to create proprietary derivative works of OpenPBS and
 * distribute them - whether embedded or bundled with other software -
 * under a commercial license agreement.
 *
 * Use of Altair's trademarks, including but not limited to "PBS™",
 * "OpenPBS®", "PBS Professional®", and "PBS Pro™" and Altair's logos is
 * subject to Altair's trademark licensing policies.
 */

/**
 * @file    checkkey.c
 *
 * @brief
 *		attr_recov.c - The 'checkkey.c' file goes with the source package is used to verify licesnse
 *
 * Included public functions are:
 *
 *	init_fl_license_attrs	initialize values of license structure
 */

#include <pbs_config.h> /* the master config generated by configure */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "portability.h"
#include "list_link.h"
#include "attribute.h"
#include "pbs_ifl.h"
#include "pbs_nodes.h"
#include "server.h"
#include "svrfunc.h"
#include "net_connect.h"
#include "pbs_error.h"
#include "log.h"
#include "pbs_license.h"
#include "work_task.h"
#include "job.h"

char *pbs_licensing_license_location = NULL;
long pbs_min_licenses = PBS_MIN_LICENSING_LICENSES;
long pbs_max_licenses = PBS_MAX_LICENSING_LICENSES;
int pbs_licensing_linger = PBS_LIC_LINGER_TIME;

/* Global Data Items: */
extern pbs_list_head svr_alljobs;

extern pbs_net_t pbs_server_addr;
unsigned long hostidnum;
int ext_license_server = 0;
int license_expired = 0;

void
return_licenses(struct work_task *ptask)
{
}

void
init_licensing(int delay)
{
}

int
status_licensing(void)
{
	return (0);
}

void
close_licensing(void)
{
}
/**
 * @brief
 * 		returning host id.
 *
 * @return      Host ID
 */
unsigned long
pbs_get_hostid(void)
{
	unsigned long hid;

	hid = (unsigned long) gethostid();
	if (hid == 0)
		hid = (unsigned long) pbs_server_addr;
	return hid;
}
/**
 * @brief
 * 		initialize values of license structure
 *
 * @param[in]	licenses - pointer to the license block structure
 */
void
init_fl_license_attrs(struct license_block *licenses)
{
	licenses->lb_glob_floating = 10000000;
	licenses->lb_aval_floating = 10000000;
	licenses->lb_used_floating = 0;
	licenses->lb_high_used_floating = 0;
	licenses->lb_do_task = 0;
}
